import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
import 'package:hygf/bean/add_grid_net_bean.dart';
import 'package:hygf/view/image_picker_widget.dart';

import '../../../../bean/CustomerList.dart';

class NetMsgState {
  bool isReadOnly = true;
  GridConnectedLink gridConnectedLink = GridConnectedLink();
  AddGridNetBean addGridNetBean = AddGridNetBean();
  TextEditingController capacityController = TextEditingController();
  TextEditingController gridAddController = TextEditingController();
  TextEditingController electricNumController = TextEditingController();
  TextEditingController correlationNumController = TextEditingController();
  TextEditingController dateController = TextEditingController();
  TextEditingController rnRemarkController = TextEditingController();
  TextEditingController gridConnectedAddressTwoController =
      TextEditingController();
  TextEditingController electricNumberTwoController = TextEditingController();
  TextEditingController correlationNumberTwoController =
      TextEditingController();
  TextEditingController gridConnectedAddressThreeController =
      TextEditingController();
  TextEditingController electricNumberThreeController = TextEditingController();
  TextEditingController correlationNumberThreeController =
      TextEditingController();
  ImagePickerWidgetController applicationProcessController =
      ImagePickerWidgetController();
  ImagePickerWidgetController recordFormController =
      ImagePickerWidgetController();
  ImagePickerWidgetController otherController = ImagePickerWidgetController();

  NetMsgState() {
    var map = Get.arguments;
    if (map["pageData"] != null) {
      CustomerListItem itemData = map["pageData"];
      gridConnectedLink.customerInfoId = itemData.id;
      if (itemData.status == 19 || itemData.status == 20 || itemData.status == 22) {
        isReadOnly = false;
        if((gridConnectedLink.gridConnectedPointDTOS??[]).isEmpty){
          GridConnectedPointDTOS gridConnectedPointDTOS = GridConnectedPointDTOS();
          gridConnectedLink.gridConnectedPointDTOS = [];
          gridConnectedLink.gridConnectedPointDTOS!.add(gridConnectedPointDTOS);
        }
      }
    }
    if(map["title"] != null){
      if(map["title"]  == "客户详情"){
        isReadOnly = true;
      }
    }
  }
}
